#include "../Route.h"
#include "../ServerStruct.h"
#include "../common/YXJSON.h"
#include "../common/YXLog.h"
#include "../common/YXResult.h"
#include "../service/AuthService.h"

static YXResult *postLoginController(Request *request, Response *response) {
    cJSON *jsonObject = request->parsed_data;
    return login(jsonObject);
}

__attribute__((constructor)) void login_controller_init() {
    addRoute("POST", "/op/login", REQUEST_BODY_ANNOTATION, postLoginController);
}
